<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>成绩列表 - 学生成绩管理系统</title>
    <link rel="stylesheet" href="/css/layui.css">
    <link rel="stylesheet" href="/css/dp07.css">
</head>
<body>
<div class="layui-container">
    <div class="layui-row layui-margin-top20">
        <div class="layui-col-md6">
            <h2>成绩列表</h2>
        </div>
        <div class="layui-col-md6" style="text-align: right;">
            <a href="/" class="layui-btn layui-btn-primary">返回首页</a>
            <a href="/score/add" class="layui-btn">添加成绩</a>
        </div>
    </div>
    
    <div class="layui-card layui-margin-top20">
        <div class="layui-card-body">
            <table class="layui-table">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>学生</th>
                    <th>学号</th>
                    <th>课程</th>
                    <th>课程编号</th>
                    <th>成绩</th>
                    <th>学期</th>
                    <th>考试时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr th:each="score : ${scores}">
                    <td th:text="${score.id}">1</td>
                    <td th:text="${score.student.name}">张三</td>
                    <td th:text="${score.student.studentNo}">2023001</td>
                    <td th:text="${score.course.courseName}">Java程序设计</td>
                    <td th:text="${score.course.courseNo}">C001</td>
                    <td th:text="${score.score}">85</td>
                    <td th:text="${score.semester}">2023-2024-1</td>
                    <td th:text="${score.examTime}">2023-12-25</td>
                    <td>
                        <a th:href="@{'/score/edit/' + ${score.id}}" class="layui-btn layui-btn-xs layui-btn-normal">编辑</a>
                        <a th:href="@{'/score/delete/' + ${score.id}}" class="layui-btn layui-btn-xs layui-btn-danger" onclick="return confirm('确定要删除此成绩记录吗？')">删除</a>
                    </td>
                </tr>
                <tr th:if="${#lists.isEmpty(scores)}">
                    <td colspan="9" style="text-align: center;">暂无成绩信息</td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>

<script src="/js/jquery-3.7.1.min.js"></script>
<script src="/js/layui.js"></script>
<script>
    layui.use(['layer', 'element'], function(){
        var layer = layui.layer;
        var element = layui.element;
    });
</script>
</body>
</html> 